package hn.cch.spring.aop.aspect;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class ExecutionTarget1 {

    private static final Logger logger = LoggerFactory.getLogger(ExecutionTarget1.class);

    public ExecutionTarget1(){
        logger.debug("ExecutionProxy1");
    }

    @Autowired
    public void setExecutionProxy0(ExecutionTarget0 executionTarget0){
        logger.debug("setExecutionProxy0:{}", executionTarget0.getClass());
    }

    @PostConstruct  // 构造函数之后执行
    public void postConstruct() {
        logger.debug("ExecutionProxy1 postConstruct");
    }


    public String method(String string) {
        String result = string;
        result += string.toLowerCase();
        return result;
    }
}
